const { get, post } = require('./http')
const prefixUrl = 'PersonalMatches'

/***** 球局 *****/
export const getMatchList = (params) => { return post(`/data/api.playermatch/matchlist`, params) } // 获取球局列表
export const getMatchInfo = (params) => { return post(`${prefixUrl}/personal_matches_info`, params) } // 获取球局详情
export const getMatchScore = (params) => { return post(`/data/api.auth.calculate/getscore`, params) } // 新--获取球局得分
export const getMatchGroup = (params) => { return post(`/data/api.auth.calculate/getgroup`, params) } // 新--分组
export const getScoring = (params) => { return post(`${prefixUrl}/getpersonalmatches_scores`, params) } // 获取球局成绩
export const getSingleScore = (params) => { return post(`/data/api.auth.calculate/getgdscore`, params) } // 获取单挂得分
export const getHomematchAuth = (params) => { return post(`/data/api.auth.playermatch/homematch`, params) } // 获取分组--授权后
export const getHomematch = (params) => { return post(`/data/api.playermatch/homematch`, params) } // 获取分组
export const statistics = (params) => { return post(`${prefixUrl}/statistics`, params) } //统计
export const statisticsMore = (params) => { return post(`${prefixUrl}/morestatistics`, params) } //更多统计
export const addStatistics = (params) => { return post(`${prefixUrl}/AddStatistics`, params) }//技术统计
export const completeMatch = (params) => { return post(`${prefixUrl}/completeMatch`, params) } // 完成球局
export const deleteMatch = (params) => { return post(`${prefixUrl}/deleteMatch`, params) } // 删除球局

export const updatematchinfo = (params) => { return post(`${prefixUrl}/updatematchinfo`, params) } // 修改球局信息
export const enableMatch = (params) => { return post(`${prefixUrl}/enableMatch`, params) } // 启用/禁用球局
export const getPlayList = (params) => { return post(`${prefixUrl}/playlist`, params) } // 玩法列表
export const getCourseList = (params) => { return post(`${prefixUrl}/getCourse`, params) } // 获取球场
export const getBillno = (params) => { return post(`${prefixUrl}/getbillno`, params) } // 获取球局单号
export const getGameScoreCard = (params) => { return post(`/data/api.playermatch/score`, params) } // 获取球局成绩卡
export const updateMatch = (params) => { return post(`${prefixUrl}/updatematch`, params) } // 获取球局场次
export const getCourseInfo = (params) => { return post(`/data/api.caddie/getcourseinfo`, params) } // 获取球场详情
export const getScoreSum = (params) => { return post(`${prefixUrl}/getscoresum`, params) } // 获取球局汇总
export const getMatchCode = (params) => { return post(`/QRCode/GetQRCode`, params,'arraybuffer') } // 球局二维码
export const getMatchResult = (params) => { return post(`/data/api.auth.newmatch/getscoring`, params) } // 获取球局结果
export const addKick = (params) => { return post(`/data/api.auth.newmatch/addfoot`, params) } // 添加踢一脚
export const getKickData = (params) => { return post(`/data/api.auth.newmatch/showfoot`, params) } // 查询本局的踢人数据

/****  规则 ****/
export const createRule = (params) => { return post(`${prefixUrl}/creatrule`, params) } //创建规则
export const getRuleList = (params) => { return post(`${prefixUrl}/getrulelist`, params) } //规则列表
export const getMyRules = (params) => { return get(`${prefixUrl}/myrulelist`, params) } // 获取常用规则
export const getDefaultRule = (params) => { return post(`${prefixUrl}/defaultrule`, params) } // 默认规则
export const updateRuleHole = (params) => { return post(`/data/api.auth.caliancematch/updaterulehole`, params) } // 更新球洞

/****  球友相关  ****/
export const getPlayerQR = (type) => { return post(`/QRCode/GetQRCode?type=${type}`, type,'arraybuffer') } //生成二维码
export const getPlayerInfo = (params) => { return post(`/Player/getplayer_info`, params) } //获取扫码玩家信息
export const addFriend = (params) => { return post(`${prefixUrl}/player_friends_add`, params) } //添加好友
export const getPlayerFriends = (params) => { return post(`${prefixUrl}/myFriends`, params) } //获取我的球友 
export const getHistoryPlayers = (params) => { return post(`${prefixUrl}/historyFriends`, params) } // 获取历史球友 

/****  围观 *****/
export const getLookers = (params) => { return post(`${prefixUrl}/onlookers`, params) } // 获取围观
export const addLookers = (params) => { return post(`${prefixUrl}/addonlookers`, params) } // 记录浏览次数

/****  押注相关 ****/
export const creatBet = (params) => { return post(`${prefixUrl}/creatbet`, params) } // 创建押注
export const getBetDeatils = (params) => { return post(`${prefixUrl}/everyonebet`, params) } //获取每个人押注
export const createMatch = (params) => { return post(`${prefixUrl}/create_personal_matches`, params) } // 创建比赛
export const addPlayer = (params) => { return post(`${prefixUrl}/addplayer`, params) } // 添加玩家
export const addScore = (params) => { return post(`${prefixUrl}/Addscore`, params) } // 设置分数
export const deleteScore = (params) => { return post(`${prefixUrl}/deletescore`, params) } // 设置分数

export const getArea = (params) => { return post(`${prefixUrl}/index`, params) } // 获取城市数据


// Tee台
export const addTee = (params) => { return post(`/data/api.auth.playermatch/addtee`, params) } // 添加tee人员
export const getTee = (params) => { return post(`/data/api.auth.playermatch/gettee`, params) } // 获取tee台列表

export const getmatchpic = (params) => { return post(`${prefixUrl}/getpersonal_matches_pic`, params) } // 获取球局相册
export const viewed = (params) => { return post(`${prefixUrl}/viewed`, params) } //流量统计

//个人主页相关
// 获取相册图片
export const getplayer_pics = (params) => {
  return post('Player/getplayer_pics', params)
}

export const deletefile = (params) => {
  return post('FileUpload/deletefile', params)
}



